package collection;

import java.util.*;

public class Demo1 {
    public static void main(String[] args) {
        Collection cc = new ArrayList();
        cc.add(new Point(1,2));
        cc.add(new Point(100,200));
        System.out.println(cc);

        Point pp = new Point(250,600);
        cc.add(pp);
        System.out.println(cc);
        pp.setX(100);
        System.out.println(cc);
        pp.setY(400);
        System.out.println(cc);
        cc.add(pp);
        System.out.println(cc);
        pp.setY(55);
        pp.setX(66);
        System.out.println(cc);
        cc.remove(pp);
        System.out.println(cc);

       Collection<Integer> ii = new ArrayList<>();
       ii.add(11);
       ii.add(22);
       ii.add(10);
        System.out.println(ii);
        Iterator<Integer> it = ii.iterator();
        while (it.hasNext()){
            int i = it.next();
            System.out.println(i);
        }
        for(int i : ii){
            System.out.println(i);
        }
        Integer[]arr = {1,2,3,4,5,6};
        List<Integer> li = Arrays.asList(arr);
        System.out.println(li);


    }
}
